package com.example.demo.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author twj
 * @version 1.0.0
 */
@Configuration
public class ApplicationContextBean {

    @Bean
    @LoadBalanced ////与 loadbalancer 集成，并开启负载均衡功能
    public RestTemplate getRestTemplate(){
        return  new RestTemplate();
    }
}
